﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using messageboard.dal;
using messageboard.model;
using System.Data;

namespace messageboard.bll
{
    public class UserBll
    {
        private UserDal userdal= null;
        public UserBll() 
        {
            userdal = new UserDal();
        }

        //判断用户名是否存在
        public bool isexist(string name)
        {
            return userdal.isexist(name);
        }

        //判断登录用户名密码
        public bool selectname(string name, string pw)
        {
            return userdal.selectname(name, pw);
        }

        //用户注册
        public bool regist(User user)
        {
            return userdal.regist(user);
        }
        //获取ID
        public int getid(string name)
        {
            return userdal.getid(name);
        }
        public DataTable getuserdetail(string name)
        {
        return userdal.getuserdetail(name);
        }

        //获取全部用户
        public DataTable getalluser() 
        {
            return userdal.getalluser();
        }


        // 删除用户
        public bool deleteuser(string name) 
        {
            return userdal.deleteuser(name);
        }
    }
}